package com.atstudy.map;

import java.util.TreeMap;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/1/4 9:52
 * @copyright: 博为峰
 */
public class TreeMapDemo {
    public static void main(String[] args) {
        TreeMap<Student, String> treeMap = new TreeMap<>(new ComparatorByName());
        treeMap.put(new Student("zhangsan", 20), "29期");
        treeMap.put(new Student("lisi", 30), "30期");
        treeMap.put(new Student("wangwu", 50), "31期");
        System.out.println(treeMap);
    }
}
